

#pragma once

#include "LuaCommon.h"

namespace LuaGui {
	class LuaGlobal {
	public:
		static void Register(lua_State* L);

		static bool IsDevEnv();
		static bool IsExistLogFile();

		static int GetWindowWidthHeight(lua_State* L);
		static std::string GetPackageDirectory();
		static std::string GetStorageDirectory();
		static std::string GetAssetDirectory();
		static std::string LoadAsset(std::string filepath);
		static std::string GetScriptDirectory();
		static std::string GetScriptTextByFilePath(std::string filepath);
		static std::string GetPlatform();
		static unsigned long long GetTimeStamp();
		static unsigned int GetTimerInterval();
		static void Sleep(int ms);
		// os

		static std::string GetClipboardText();
		static bool SetClipboardText(std::string text);

		// datetime

		// filesystem
		static std::string GetCurrentPath();
		static std::string FormatPath(std::string path);
		static std::string GetAbsolutePath(std::string path);
		static bool IsAbsolutePath(std::string path);
		static bool IsRegularFile(std::string path);
		static bool IsDirectory(std::string path);
		static bool CreateDirectory(std::string path);
		static bool RemoveDirectory(std::string path, bool recursive);
		static void Rename(std::string old_path, std::string new_path);
		static bool Exists(std::string path);

		static std::vector<std::string> GetFileList(std::string path, bool recursive);
	};
}
